package com.lianup.noname;

import com.lianup.noname.connector.HttpConnector;
import com.lianup.noname.container.HeaderLoggerValve;
import com.lianup.noname.container.SimpleLoader;
import com.lianup.noname.container.wrapper.SimpleWrapper;
import org.apache.catalina.Loader;
import org.apache.catalina.Pipeline;
import org.apache.catalina.Valve;
import org.apache.catalina.Wrapper;

import java.awt.*;

/**
 * tomcat启动类
 */
public final class Bootstrap {

    public static void main(String[] args){
        HttpConnector connector = new HttpConnector();
        SimpleWrapper wrapper = new SimpleWrapper();
        wrapper.setServletClass("ModernServlet");
        Loader loader = new SimpleLoader();
//        Valve valve1 = new HeaderLoggerValve();
//          Valve valve2 = new ClientIPLoggerValve();

        wrapper.setLoader(loader);
//        ((Pipeline) wrapper).addValve(valve1);
//        ((Pipeline) wrapper).addValve(valve2);

        connector.setContainer(wrapper);
        connector.start();
    }
}
